<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    // Class 可以通过extends关键字实现继承，这比 ES5 的通过修改原型链实现继承，要清晰和方便很多

    // 父类
    class Person{
        constructor(name, age){
            this.name = name;
            this.age = age;
        }
        species = "human";
        skill(){
            console.log("thinking");
        }
        say(){
            console.log(this.name, this.age);
        }
    }

    class YellowPerson extends Person{
        
    }
</script>
</html>